<template>
    <z-block url="/do/get/contract" :params="params">
        <template #default="contract">
            <el-descriptions column="2">
                <el-descriptions-item label="合同名称">{{ contract.title }}</el-descriptions-item>
                <el-descriptions-item label="合同编号">
                    {{ contract.code }}
                </el-descriptions-item>
                <el-descriptions-item label="合同类型">
                    <z-text :modelValue="contract.categoryId" depend="category" size="large"/>
                </el-descriptions-item>
                <el-descriptions-item label="合同状态">
                    <z-dict readonly :modelValue="contract.status" code="contractStatus"/>
                </el-descriptions-item>
                <el-descriptions-item>
                    <el-steps style="max-width: 600px" :active="contract.stage" align-center>
                        <el-step title="草拟"/>
                        <el-step title="审批"/>
                        <el-step title="签署"/>
                        <el-step title="归档"/>
                        <el-step title="履行"/>
                        <el-step title="完结"/>
                    </el-steps>
                </el-descriptions-item>
            </el-descriptions>
            <div class="form-spacing"></div>
            <z-page-title value="履约概况"/>
            <el-descriptions direction="vertical" :column="6" border>
                <el-descriptions-item label="履约对象">
                    <z-text :modelValue="contract.performParty" depend="party" size="large"/>
                </el-descriptions-item>
                <el-descriptions-item label="履约状态">
                    <z-dict readonly :modelValue="contract.performStatus" code="performStatus"/>
                </el-descriptions-item>
                <el-descriptions-item label="合同金额">
                    <z-money :modelValue="contract.total"/>
                </el-descriptions-item>
                <el-descriptions-item :label="contract.inorout === 2 ? '合同应收' : '合同应付'">
                    <z-money :modelValue="contract.inorout === 2 ? contract.receivable : contract.payable"/>
                </el-descriptions-item>
                <el-descriptions-item :label="contract.inorout === 2 ? '回款金额' : '付款金额'">
                    <z-money :modelValue="contract.inorout === 2 ? contract.receipts : contract.payment"/>
                </el-descriptions-item>
                <el-descriptions-item :label="contract.inorout === 2 ? '开票金额' : '收票金额'">
                    <z-money :modelValue="contract.inorout === 2 ? contract.invoiceIssuance : contract.invoiceReceipt"/>
                </el-descriptions-item>
            </el-descriptions>
        </template>
    </z-block>
</template>

<script>


export default {
    props: {
        params: Object,
    },
    data() {
        return {}
    },
}
</script>

<style scoped>
.form-spacing {
    margin: 10px 0;
    height: 0;
    position: relative;
}
</style>
